{% extends "pretixcontrol/event/base.html" %}
{% load i18n %}
{% load bootstrap3 %}
{% block content %}
    <h1>{% trans "Cancel or delete event" %}</h1>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{% trans "Go offline" %}</h3>
        </div>
        <div class="row panel-body">
            <div class="col-sm-12 col-md-9 nomargin-bottom">
                {% blocktrans trimmed %}
                    You can take your event offline. Nobody except your team will be able to see or access it any more.
                {% endblocktrans %}
            </div>
            <div class="col-sm-12 col-md-3">
                <form action="{% url "control:event.live" event=request.event.slug organizer=request.organizer.slug %}"
                        method="post">
                    {% csrf_token %}
                    <input type="hidden" name="live" value="false">

                    <button type="submit" class="btn btn-primary btn-lg btn-block">
                        <span class="fa fa-power-off"></span>
                        {% trans "Go offline" %}
                    </button>
                </form>
            </div>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{% trans "Cancel event" %}</h3>
        </div>
        <div class="row panel-body">
            <div class="col-sm-12 col-md-9 nomargin-bottom">
                {% blocktrans trimmed %}
                    If you need to call off your event you want to cancel and refund all tickets, you can do so through
                    this option.
                {% endblocktrans %}
            </div>
            <div class="col-sm-12 col-md-3">
                <a href="{% url "control:event.cancel" organizer=request.organizer.slug event=request.event.slug %}"
                        class="btn btn-delete btn-danger btn-block btn-lg">
                    <span class="fa fa-ban"></span>
                    {% trans "Cancel event" %}
                </a>
            </div>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{% trans "Delete personal data" %}</h3>
        </div>
        <div class="row panel-body">
            <div class="col-sm-12 col-md-9 nomargin-bottom">
                {% blocktrans trimmed %}
                    You can remove personal data such as names and email addresses from your event and only retain the
                    financial information such as the number and type of tickets sold.
                {% endblocktrans %}
            </div>
            <div class="col-sm-12 col-md-3">
                <a href="
{% url "control:event.shredder.start" event=request.event.slug organizer=request.organizer.slug %}" class="btn btn-delete btn-danger btn-lg btn-block">
                    <span class="fa fa-eraser"></span>
                    {% trans "Delete personal data" %}
                </a>
            </div>
        </div>
    </div>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">{% trans "Delete event" %}</h3>
        </div>
        <div class="row panel-body">
            <div class="col-sm-12 col-md-9 nomargin-bottom">
                {% blocktrans trimmed %}
                    You can delete your event completely only as long as it does not contain any undeletable data, such as
                    orders not performed in test mode.
                {% endblocktrans %}
            </div>
            <div class="col-sm-12 col-md-3">
                <a href="{% url "control:event.delete" organizer=request.organizer.slug event=request.event.slug %}"
                        class="btn btn-delete btn-danger btn-block btn-lg {% if not request.event.allow_delete %}disabled{% endif %}">
                    <span class="fa fa-trash"></span>
                    {% trans "Delete event" %}
                </a>
            </div>
        </div>
    </div>

{% endblock %}
